package com.flyone.qybackend.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.flyone.qybackend.model.dto.diary.DiarySaveRequest;
import com.flyone.qybackend.model.entity.Diary;
import com.flyone.qybackend.model.entity.RecordInfo;
import com.flyone.qybackend.model.entity.ScoreDiary;

import java.util.List;

/**
* @author luoyifei
*/
public interface DiaryService extends IService<Diary> {
    /**
     * 获取当日日记
     *
     * @param userId
     * @return
     */
    List<Diary> getDiaryWithDay(String date,Long userId);

    /**
     * 保存所写日记
     * @param diarySaveRequest
     * @param userId
     * @return
     */
    long saveWrite(DiarySaveRequest diarySaveRequest, long userId);

    /**
     * 根据id删除日记
     * @param diaryId
     * @param userId
     * @return
     */
    boolean removeDiary(long diaryId, Long userId);

    /**
     * 根据id修改日记
     * @param diarySaveRequest
     * @param userId
     * @return
     */
    boolean updateWrite(DiarySaveRequest diarySaveRequest, Long userId);

    /**
     * 返回心情指数及日记情绪
     * @param mouth
     * @param userId
     * @return
     */
    ScoreDiary getScoreWithDiary(int mouth, Long userId);

    /**
     * 返回日记数量
     * @param id
     * @return
     */
    int getDiaryCount(Long id);

    /**
     * 返回日记记录天数和总字数
     * @param userId
     * @return
     */
    RecordInfo getRecordInfo(Long userId);
}
